<div id="newnits">
<?php
require_once 'FacebookLike.php';
$gridScale = 120;
$gridGaps = 5;
$like = new FacebookLike();
$like->layout = FacebookLike::LAYOUT_BUTTON_COUNT;
foreach ($this->gridBoxes as $box)
{
    $left = ($box->left * $gridScale + $gridGaps);
    $top = ($box->top * $gridScale + $gridGaps);
    $width = ($box->width * $gridScale - $gridGaps * 2);
    $height = ($box->height * $gridScale - $gridGaps * 2);
	$imgUrl = $box->feed_entry->enclosure != null ? $box->feed_entry->enclosure : $this->baseUrl('c/i/paper.png');
	$link = "<a href='" . $this->url(array('controller' => 'Feeds', 'action' => 'redirect', 'feid' => $box->feed_entry->id)) . "'>";
    echo '<img src="' . $imgUrl . '" alt="newnit_bg" ';
    echo 'style="';
    echo 'left:' . $left . 'px;';
    echo 'top:' . $top . 'px;';
    echo 'width:' . $width . 'px;';
    echo 'height:' . $height . 'px;';
    echo '"';
    echo '/>';
    echo '<div class="newnit" style="';
    echo 'left:' . $left . 'px;';
    echo 'top:' . $top . 'px;';
    echo 'width:' . $width . 'px;';
    echo 'height:' . $height . 'px;';

    echo '">';
    echo '<h1 class="feed_title">';
    echo $link;
    echo $box->feed_entry->title;
    echo '</a>';
    echo '</h1>';
    if (!$box->feed_entry->enclosure)
    {
        echo '<span class="description">';
        echo $box->feed_entry->description;
        echo '</span>';
    }
    $like->page = $box->feed_entry->link;
    $lke->width = $box->width;
    echo (string)$like;
    echo '</div>';
}
?>

<div id="gridLogo" class="newnit_major" style="left: <?php echo $gridGaps;?>px;
							top: <?php echo $gridGaps;?>px;
							width: <?php echo $gridScale * 3 - $gridGaps * 2;?>px;
							height: <?php echo $gridScale - $gridGaps * 2;?>px;">
    <a href="<?php echo $this->url(array('controller' => 'index', 'action' => 'index'));?>">
		<img src="<?php echo $this->baseUrl('i/logo.png');?>" alt="theGridPaper logo" />
    </a>
	<ul>
    <li><a href="<?php echo $this->url(array('controller' => 'Account', 'action' => 'logout'));?>">Logout</a></li>
    <li><a class='config_link' href="<?php echo $this->url(array('controller' => 'Account', 'action' => 'config'));?>">Settings</a></li>
    <li><a class='config_link' href="<?php echo $this->url(array('controller' => 'About', 'action' => 'index'));?>">About</a></li>
	</ul>
</div>
</div>
